﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NIP.DynamicControl
{
    public class RobotControlEventArgs:EventArgs
    {
        public double X {set;get;}
        public double Y { set; get; }
        public double Z { set; get; }
        public double gPitch { set; get; }
        public double gRoll { set; get; }
        public double gOffset { set; get; }
        public int holdPWM { set; get; }
        public double[] Angle { set; get; }
        public double kp { set; get; }
        public double ki { set; get; }
        public double kd { set; get; }
        public int joint { set; get; }
        public ControlCommands command { set; get; }

        public RobotControlEventArgs()
        {
            X = double.NaN;
            Y = double.NaN;
            Z = double.NaN;
            gPitch = 90.0;
            gRoll = 0.0;
            gOffset = 0.0;
            holdPWM = 1300;
            Angle = null;
            kp = double.NaN;
            ki = double.NaN;
            kd = double.NaN;
            joint = 0;
            command = ControlCommands.NULL;
        }
        public RobotControlEventArgs(ControlCommands _command, double _x, double _y, double _z, double _gPitch = -90.0, double _gRoll = 0.0, double _gOffet = 0.0)
        {
            command = _command;
            X = _x;
            Y = _y;
            Z = _z;
            gPitch = _gPitch;
            gRoll = _gRoll;
            gOffset = _gOffet;
            holdPWM = 1300;
            Angle = null;
            kp = double.NaN;
            ki = double.NaN;
            kd = double.NaN;
            joint = 0;
        }

        public void OffsetZ(ref RobotControlEventArgs command, double offsetValue)
        {
            command.Z += offsetValue;
        }
    }
}
